import commonjs from '@rollup/plugin-commonjs';
import postcss from 'rollup-plugin-postcss';
import {nodeResolve} from '@rollup/plugin-node-resolve';
import json from '@rollup/plugin-json';
// import nodePolyfills from 'rollup-plugin-node-polyfills';

/*
import postcssPreset from 'postcss-preset-env';*/
// import {name} from '../package.json';
/*import {resolve} from 'path';

console.log('........', resolve);*/

const extensions = [
    '.mjs', '.json'
];

const rollupConfigBase = {
    context: 'window',
    watch: {
        include: [
            'src/**'
        ]
    },
    plugins: [
        json(),
        postcss(),
        // nodePolyfills(),
        nodeResolve({extensions}),
        commonjs()
    ]
};

export default rollupConfigBase;